import java.util.Scanner;

public class TestDemo6 {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int[] array = new int[5];
        for (int i = 0; i < array.length; i++) {
            array[i] = scan.nextInt();
        }
        int ret = 0;
        for (int i = 0; i < array.length; i++) {
            ret = ret ^ array[i];
        }
        System.out.println(ret);
    }
}
